﻿<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>新闻中国</title>
    <link href="../../../static/css/main.css" rel="stylesheet" type="text/css"/>
    <script type="text/javascript" src="../../../static/js/jquery-1.12.4.min.js"></script>
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
</head>
<body>
<div id="opt_area">
    <h1 id="opt_type"> 编辑新闻： </h1>

    <form id="myform"
          method="post" enctype="multipart/form-data">
        <p>
            <label> 主题 </label>
            <select name="tid" id="mySelect">
                <c:forEach items="${sessionScope.topic}" var="item">
                    <option name="tid"
                            value="${item.tid}" ${item.tid == sessionScope.detailNews.ntid?'selected':''}>${item.tname}</option>
                </c:forEach>
            </select>
        </p>
        <p>
            <label> 标题 </label>
            <input name="ntitle" id="ntitle" type="text" class="opt_input"
                   value="${sessionScope.detailNews.ntitle}"/>
        </p>
        <p>
            <label> 作者 </label>
            <input name="nauthor" id="nauthor" type="text" class="opt_input"
                   value="${sessionScope.detailNews.nauthor}"/>
        </p>
        <p>
            <label> 摘要 </label>
            <textarea name="nsummary" id="nsummary" cols="40"
                      rows="3">${sessionScope.detailNews.nsummary}</textarea>
        </p>
        <p>
            <label> 内容 </label>
            <textarea name="ncontent" id="ncontent" cols="70"
                      rows="10">${sessionScope.detailNews.ncontent}</textarea>
        </p>
        <p>
            <label> 上传图片 </label>
            <input name="file" id="file" type="file" class="opt_input"/>
        </p>
        <input type="hidden" name="nid" id="nid" value="${sessionScope.detailNews.nid}"/>
        <input type="hidden" name="ntid" id="ntid" value="${sessionScope.detailNews.ntid}"/>
        <input type="button" onclick="updateNews()" value="提交" class="opt_sub"/>
        <input type="reset" value="重置" class="opt_sub"/>
    </form>
    <h1 id="opt_type">
        修改新闻评论：
    </h1>
    <div id="admincomment"></div>
</div>
</body>
</html>

